function ratingButtonClick(element, alias) {
    var elementParent = element.parentNode
    elementParent.innerHTML = '<img src="/img/spin.gif" style="height: 32px; width: 32px;" alt="Loading" />';
    
    var value = parseInt(element.options[element.selectedIndex].value);
    
    frame = document.createElement('iframe');
    frame.setAttribute('src', '/ajax/rate.php?tool=' + alias + '&val=' + value);
    frame.setAttribute('style', 'display: none;');
    document.getElementsByTagName('body')[0].appendChild(frame);
    
    function ol(elementParent) {
	elementParent.innerHTML = "<i>Thank you for rating!</i>";
	EDJXConfirmer.show_ok();
    }
    frame.onload = ol(elementParent);
}

function ratingUpdate(value) {
    if(value >= 4.75) {
	imgSrc = '/img/rated/50.png';
    } else if(value >= 4.25) {
	imgSrc = '/img/rated/45.png';
    } else if(value >= 3.75) {
	imgSrc = '/img/rated/40.png';
    } else if(value >= 3.25) {
	imgSrc = '/img/rated/35.png';
    } else if(value >= 2.75) {
	imgSrc = '/img/rated/30.png';
    } else if(value >= 2.25) {
	imgSrc = '/img/rated/25.png';
    } else if(value >= 1.75) {
	imgSrc = '/img/rated/20.png';
    } else if(value >= 1.25) {
	imgSrc = '/img/rated/15.png';
    } else if(value >= 0.75) {
	imgSrc = '/img/rated/10.png';
    } else if(value >= 0.25) {
	imgSrc = '/img/rated/05.png';
    } else {
	imgSrc = '/img/rated/00.png';
    }
    document.getElementById('ratingImg').src = imgSrc;
}